
--[[
* 技能 ai 释放条件类型
* 配负数,表示取反
]]
---@class SkillAiConditionType
SkillAiConditionType = ClientFight.CreateClass("SkillAiConditionType")
function SkillAiConditionType:ctor(type,actionFuc)
    self.type = type
    map[type] = self;
end
local map = {}
---自由指定 目标
SkillAiConditionType.TARGET_APPOINT = SkillAiConditionType.New(1)
function SkillAiConditionType.TARGET_APPOINT:action(fighter,  target, skill, param)
    return target.modelId == param;
end
---血量万分比<=
SkillAiConditionType.HP =  SkillAiConditionType.New(2)
function SkillAiConditionType.HP:action(fighter,  target, skill, param)
    local targetHp = target.hp;
    local ratio = targetHp / FighterAttributeManager.getFightAttr(target, FighterAttributeEnum.HP);
    return ratio * 10000 <= param;
end
--能量值 <=
SkillAiConditionType.ENERGY = SkillAiConditionType.New(3)
function  SkillAiConditionType.ENERGY:action(fighter,  target, skill, param)
    return target.energy <= param;
end

function SkillAiConditionType.valueOf( type)
return map[type];
end
